package com.youpai.platform.wallet.service.enums;


import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum ChangeCoinTypeEnums {

    PURCHASE(1, "充值购买获取"),
    EARN_BY_SERVICES(2, "通过服务项目赚取"),
    EARN_BY_ACTIVITY(3, "通过运营活动获取"),

    PAY_FOR_SERVICE(4, "服务支付"),
    ;

    public final int type;

    public final String desc;


    /**
     * 校验type
     *
     * @param type type
     * @return 校验结果
     */
    public static boolean validType(int type) {
        for (ChangeCoinTypeEnums value : ChangeCoinTypeEnums.values()) {
            if (type == value.type) {
                return true;
            }
        }
        return false;
    }
}
